var app = getApp();

Page({
    data: {
        navH: 0,
        imgPath: app.getImgUrl(),
        isReceive: !1
    },
    receive: function() {
        var e;
        app.globalData.userInfo ? (e = this, app.util.request({
            url: "entry/wxapp/receiveNew",
            success: function(a) {
                console.log(a), "ok" == a.data.message && (e.setData({
                    isReceive: !0
                }), wx.showModal({
                    title: "系统提示",
                    content: "恭喜您获得" + app.globalData.setting.new_guy_bouns + "元红包，请跳转至“我的”页面查看>>",
                    showCancel: !1,
                    confirmColor: "#f43f6c",
                    confirmText: "去查看",
                    success: function(a) {
                        wx.switchTab({
                            url: "../my/my"
                        });
                    }
                }));
            }
        })) : app.checkLogin();
    },
    loginAfter: function(a) {
        app.loginAfter(a);
    },
    loginCancel: function() {
        app.loginCancel();
    },
    checkReceive: function() {
        app.globalData.userInfo && this.setData({
            isReceive: app.globalData.userInfo.isReceiveNew
        });
    },
    goVip: function() {
        wx.navigateTo({
            url: "../guest/guest"
        });
    },
    goCash: function() {
        wx.navigateTo({
            url: "../cash/cash"
        });
    },
    goPartakeOf: function() {
        wx.navigateTo({
            url: "../partake/partake"
        });
    },
    onLoad: function(a) {
        this.setData({
            navH: app.globalData.navHeight,
            withdraw_open: app.globalData.setting.withdraw_open
        }), this.checkReceive();
    },
    navBack: function() {
        wx.navigateBack();
    },
    toIndex: function() {
        wx.switchTab({
            url: "../index/index"
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {
        var a = app.globalData.setting.share_title || "购物省钱，分享赚钱", e = app.globalData.setting.share_pic;
        return {
            title: a,
            path: "/first_duoduoke/pages/index/index" + (void 0 !== app.globalData.userInfo.uid ? "?from_uid=" + app.globalData.userInfo.uid + "&from_act=share" : ""),
            imageUrl: e,
            success: function(a) {
                "shareAppMessage:ok" == a.errMsg ? wx.showToast({
                    title: "分享成功",
                    icon: "success"
                }) : wx.showToast({
                    title: "分享失败",
                    icon: "none"
                });
            },
            fail: function(a) {
                "shareAppMessage:fail cancel" == a.errMsg || a.errMsg, wx.showToast({
                    title: "分享失败",
                    icon: "none"
                });
            }
        };
    }
});